﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Facade
{


    public interface IRun
    {
        void Run();
    }

    public interface IShot
    {
        void Shot();
    }
    public interface ISay
    {
        void Say();
    }

    public class Facade
    {
        IRun runEntity;
        IShot shotEntity;
        ISay sayEntity;
        public Facade(IRun run)
        {
            this.runEntity = run;
        }

        public Facade(IShot shot)
        {
            this.shotEntity = shot;
        }

        public Facade(ISay say)
        {
            this.sayEntity = say;
        }

        public Facade(IRun run, IShot shot, ISay say) : this(run)
        {
            this.shotEntity = shot;
            this.sayEntity = say;
        }
        public void Shot()
        {
            if (shotEntity != null)
            {
                shotEntity.Shot();
            }
        }


    }

    public class T50 : Facade
    {
        public T50(IRun run, IShot shot, ISay say) : base(run, shot, say)
        {

        }
    }

    public class T50Expand : T50
    {
        public T50Expand(IRun run, IShot shot, ISay say) : base(run, shot, say)
        {
        }

        public void Expand()
        {
            Console.WriteLine("拓展方法。。");
        }
    }

    public class shotClass : IShot
    {
        public void Shot()
        {
            Console.WriteLine("开始发射子弹！！！");
        }
    }

}
